#set(String masterMenu = "1")
#set(String sysActiveMenu = "2")
#tag layout_block("sidebar")
	#include("/fragment/menu.html")
#end
#tag layout_block("main")
	<div id="table-manager" v-cloak>
		<div class="col-xs-offset-2 col-xs-4">
			<div class="form-group">
				<input type="text" class="form-control" placeholder="请输入桌位编码" v-model="searchName">
			</div>
		</div>
		<div class="col-xs-2">
			<div class="form-group">
				<select class="form-control" v-model="searchType">
					<option value="">桌位类型</option>
					<option v-for="val in dicType" value="{{$key}}">{{val}}</option>
				</select>
			</div>
		</div>
		<div class="col-xs-4">
			<button type="button" class="btn btn-primary" @click="reloadContent(0)">查询</button>
			<button type="button" class="btn btn-info" @click="addRecord()">新建</button>
		</div>
		<div class="col-xs-12">
			<table class="table table-hover custom-table">
				<thead>
					<tr>
						<th>序号</th>
						<th>编码</th>
						<th>类型</th>
						<th>说明</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr v-for="item in content">
						<td>{{page*size+$index+1}}</td>
						<td>{{item.NUM}}</td>
						<td>{{dicType[item.TYPE]}}</td>
						<td>{{item.DESCR}}</td>
						<td>
							<button type="button" class="btn btn-xs btn-primary" @click="editRecord(item)">编辑</button>
							<button type="button" class="btn btn-xs btn-danger" @click="delRecord(item.ID)">删除</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="col-xs-12 archive-pages text-center" id="laypage-ctl"></div>
		<!-- Modal -->
		<div class="modal fade" id="table-modal" tabindex="-1" role="dialog"
			aria-labelledby="tableModalLabel" aria-hidden="true" data-backdrop="static">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
						</button>
						<h4 class="modal-title" id="tableModalLabel">增加桌位</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" role="form" style="margin-top: 10px;">
							<div class="form-group">
								<label for="num" class="col-sm-2 control-label">编码</label>
								<div class="col-sm-9">
									<input name="num" type="text" class="form-control" placeholder="桌位数字编码，用于定位数据" v-model="info.num">
								</div>
							</div>
							<div class="form-group">
								<label for="type" class="col-sm-2 control-label">编码</label>
								<div class="col-sm-9">
									<select class="form-control" v-model="info.type">
										<option v-for="val in dicType" value="{{$key}}">{{val}}</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label for="descr" class="col-sm-2 control-label">说明</label>
								<div class="col-sm-9">
									<textarea name="descr" class="form-control" rows="3" placeholder="简要说明桌位内容" v-model="info.descr"></textarea>
								</div>
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" @click="saveRecord()">保存</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="assets/js/laypage.js"></script>
	<script type="text/javascript" src="assets/js/biz/table/manager.js"></script>
#end
#include ("/layout/default.html")
